abstract class Fruit {
    public abstract void eat();
    public abstract void accept(FruitVisitor visitor);
}
class Apple extends Fruit {
    @Override
    public void eat() {
        System.out.println("eat Apple");
    }

    @Override
    public void accept(FruitVisitor visitor) {
        visitor.visit(this);
    }
}

class Banana extends Fruit {
    @Override
    public void eat() {
        System.out.println("eat Banana");
    }

    @Override
    public void accept(FruitVisitor visitor) {
        visitor.visit(this);
    }
}